﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="SubjectList.aspx.cs" Inherits="Xiaov.SmartWeb.Application.PluginSrc.GuestBook.SubjectList" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
      <link rel="stylesheet" type="text/css" href="/Resources/xiaovcn/css/xiaov-form.css"/>
    <script type="text/javascript" src="/Resources/xiaovcn/scripts/usercheck.js"></script>

    <script type="text/javascript" src="/Resources/ueditor/editor_config.js" ></script>
    <script type="text/javascript" src="/Resources/ueditor/editor_all_min.js" ></script>

    <script type="text/javascript">
        $(document).ready(function () {            
            bindgrid("","");
        });

        function bindgrid(c,key) {
            $('#tt').datagrid({
                url: 'Json/Subject.aspx?c=' + c + '&key=' + key + '&bid=<%=BId%>',
                title: ' 信息列表', rownumbers: true, height: userScreenHeight -13, fitColumns: false, singleSelect: true, striped: true, pagination: true,
                iconCls:'icon-applicationgo',
                columns:
                [
                     [{ field: 'TCLASS', width: 80, title: '分类', formatter: function (val, rec) { return unescape(rec.TCLASS); } },
                      {
                          field: 'TITLE', width: 400, title: '标题', formatter:
                            function (val, rec) {
                                if (rec.ISTOP == "1")                                    
                                    return "<img src='\\Resources\\easyui-1.32\\themes\\icons\\top.gif'>" + unescape(rec.TITLE);
                                else
                                    return unescape(rec.TITLE);
                            }
                      },
                      { field: 'AUTHOR', width: 120, title: '发布人', formatter: function (val, rec) { return unescape(rec.AUTHOR); } },
                      { field: 'PUBDATE', width: 120, title: '发布时间', formatter: function (val, rec) { return unescape(rec.PUBDATE); } },
                     //[{ field: 'TCLASS',width:100, title: '分类', rowspan: 2, formatter: function (val, rec) { return unescape(rec.TCLASS); } },
                      { field: 'CommentCount', width: 100, title: '评论', rowspan: 2, formatter: function (val, rec) { return unescape(rec.CommentCount); } }]
                     //{ field: 'PUBDATE',width:100, title: '发布时间', rowspan: 2, formatter: function (val, rec) { return unescape(rec.PUBDATE); } }]
                ],
                toolbar: [{
                    text: '发布新主题',
                    iconCls: 'icon-add',
                    disabled:<%=(!Permissions[0].Allow&&!PUser.Super).ToString().ToLower()%>,
                    handler: function () {
                        window.location.href = 'NewSubject.aspx';
                    }
                }
                ],
                onClickRow: function (index, row) {
                    window.location.href = 'ViewSubject.aspx?id='+row.ID;
                }
            });
        }

    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div style="font-size:12px;padding-bottom:5px;">
       <input class="easyui-searchbox" data-options="prompt:'Please Input Value',menu:'#mm',searcher:doSearch" style="width:300px"/>
	<div id="mm" style="width:120px">
		<div data-options="name:'TITLE',iconCls:'icon-tick'">标题</div>
		<div data-options="name:'CONTENT',iconCls:'icon-tick'">内容</div>
	</div>
	<script>
	    function doSearch(value, name) {
	        //alert('You input: ' + value + '(' + name + ')');
	        bindgrid(name, value);
	    }
	</script>
    </div>
    <table id="tt">
	</table>
</asp:Content>
